<script setup lang="ts">
const isLoadded = ref(false);

defineProps<{
  src: string;
  alt: string;
}>();
</script>

<template>
  <div
    class="w-full inline-block leading-0 overflow-hidden"
    :class="[isLoadded ? 'aspect-auto' : 'aspect-video']"
  >
    <NuxtImg
      class="w-full"
      loading="lazy"
      :src="src"
      :alt="alt"
      @load="isLoadded = true"
    />
  </div>
</template>
